package com.swak.reactivex.transport.exception;

import lombok.Getter;

/**
 * 数据交换异常
 * 
 * @author 618lf
 */
public class ExchangeException extends Exception {

	private static final long serialVersionUID = 1L;

	public static enum ExchangeMethod {
		Write, Read
	}

	@Getter
	private final ExchangeMethod method;
	@Getter
	private final Object data;

	public ExchangeException(ExchangeMethod method, Object data, String error) {
		super(error);
		this.method = method;
		this.data = data;
	}

	public ExchangeException(ExchangeMethod method, Object data, Throwable error) {
		super(error);
		this.method = method;
		this.data = data;
	}
}